package com.yunkeji.api.feedback.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.yunkeji.api.feedback.bo.SubmitFeedbackBo;
import com.yunkeji.api.feedback.service.FeedbackService;
import com.yunkeji.common.helper.LoginHelper;
import com.yunkeji.dao.domain.UserFeedback;
import com.yunkeji.dao.mapper.UserFeedbackMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
/** @author 老张 */
@RequiredArgsConstructor
@Service
public class FeedbackServiceImpl implements FeedbackService {
    private final UserFeedbackMapper userFeedbackMapper;

    @Override
    public void submit(SubmitFeedbackBo bo) {
        UserFeedback userFeedback = BeanUtil.toBean(bo, UserFeedback.class);
        userFeedback.setUserId(LoginHelper.getUserId());
        userFeedbackMapper.insert(userFeedback);
    }
}
